//
// Created by xbm on 23-3-9.
//

#ifndef WEBSERVER_TIMEIT_H
#define WEBSERVER_TIMEIT_H

#include <iostream>
#include <chrono>

using namespace std;
using namespace chrono;
namespace util {

void time_it(auto fun, auto...args) {
    auto start = chrono::high_resolution_clock::now();
    fun(args...);
    auto end = chrono::high_resolution_clock::now();
    auto duration = duration_cast<microseconds>(end - start);
    cout << "run Time is " << duration.count() * 0.001 << "ms\n";
}
}
#endif //WEBSERVER_TIMEIT_H
